﻿@*IEnumerable<rateITcd.Models.RestaurantDish>*@
<!-- Details page: show all dishes of a certain restaurant -->

<div class="page-header">
    <h1>@ViewBag.Restaurant.Name  <span class="pull-right">
    @if (User.IsInRole("Admin"))
    {
        @Html.ActionLink("Add Dish", "Create", "RestaurantDish", new { id = @ViewBag.Restaurant.Id }, new { @class = "btn btn-default btn-sm" })
        @Html.ActionLink("Edit", "Edit", "Restaurant", new { id = @ViewBag.Restaurant.Id }, new { @class = "btn btn-default btn-sm" })
        @Html.ActionLink("Delete", "Delete", "Restaurant", new { id = @ViewBag.Restaurant.Id }, new { @class = "btn btn-default btn-sm" })
    }
    </span></h1>
</div>

<div class="row">
    <div class="col-md-4">
        <div class="well">
            @ViewBag.Restaurant.AdressStreet @ViewBag.Restaurant.AdressNumber <br />
            @ViewBag.Restaurant.AdressZip @ViewBag.Restaurant.AdressCity
        </div>
    </div>
    <div class="col-md-8">
        <table class="table ">
            <tr>
                <th data-i18n="DishName">
                    Dish Name
                </th>
                <th data-i18n="Price">
                    Price
                </th>
                <th></th>
                @if (User.IsInRole("Admin"))
                {
                    <th></th>
                }
            </tr>

            @foreach (var item in ViewBag.Dishes)
            {
                <tr>
                    <td>
                        @item.Name
                    </td>
                    <td>
                        &euro; @item.Price
                    <td>
                        @Html.ActionLink("Reviews", "Details", "DishReview", new { id = item.Id }, new { data_i18n = "Reviews" })

                    </td>
                    @if (User.IsInRole("Admin"))
                    {
                        <td>
                            @Html.ActionLink("Edit", "Edit", "RestaurantDish", new { id = item.Id }, "") |
                            @Html.ActionLink("Delete", "Delete", "RestaurantDish", new { id = item.Id }, "")
                        </td>
                    }
                </tr>
            }

        </table>
    </div>
</div>